home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c,gnu.gcc.help,comp.unix.programmer
- Subject: Re: Help for using bcopy function
- Date: 5 Mar 1996 07:51:17 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4hhntlINNr3k@keats.ugrad.cs.ubc.ca>
- References: <4gl53u$4bv@kocrsv08.delcoelect.com> <ELIAS.96Feb27144032@cepheus.omicron.se> <31372F78.167EB0E7@pia.bt.co.uk> <y9ybumcc5i0.fsf@ernst.ida.his.se>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <y9ybumcc5i0.fsf@ernst.ida.his.se>,
- Stefan 'Stetson' Skoglund <sp2stes1@ida.his.se> wrote:
- > >> bcopy() is not standard AFAIK. Use memcpy instead.
- >
- >
- > Alwyn> It's certainly standard on SunOS.
- >
- >Which version of SunOS ??? SunOS 2.4 doesn't have it in libc at least.
-
- SunOS 2.4? Man, that is ancient. (Or you surely mean _Solaris_ 2.4?)
-
- >It do exist in /usr/ucblib/libucb.so but that is the bsd compatibility
- >package which I try to stay away from.
-
- The bcopy() function is tolerable wherever inet socket programming is done.
- Everywhere else, memcpy(). A lot of programs that open sockets use functions
- like bcopy and bzero for traditional reasons (because the network programming
- interface is BSD derived, and these support functions travel wherever it does).
- Heck, they even work under Trumpet Winsock. (ugh!)
-
- bcopy() is frequently used to copy an array of four characters representing an
- inet address (derived from the struct hostent structure which comes from
- gethostbyname()) over top of a struct in_addr (part of a struct sockaddr_in),
- which holds an unsigned int. It's ugly, but go figure. :)
- --
-
-